package gc;

import java.lang.reflect.Array;
import java.util.ArrayList;

/**
 * @author ZhengDp
 * @Date 2023/5/13 15:34
 */
public class GC_Demo2 {

    private static final int _512KB  = 512 * 1024;
    private static final int _1MB = 1024 * 1024;
    private static final int _6MB = 6 * 1024 * 1024;
    private static final int _7MB = 7 * 1024 * 1024;
    private static final int _8MB = 8 * 1024 * 1024;
    //  初始     最大 20 新生代10   设置垃圾回收器     打印GC详情
    // -Xms20m -Xmx20M -Xmn10M -XX:+UseSerialGC -XX:+PrintGCDetails -verbose:gc
    public static void main(String[] args) throws InterruptedException {
        new Thread(() -> {
            ArrayList<byte[]> list = new ArrayList<>();
            list.add(new byte[_8MB]);
            list.add(new byte[_8MB]);
        }).start();

    }

}
